Skip to content

PDX-476: fix(mcp): Copilot PR #161 follow-ups — AJV error mapping, catalog source shape, bin alias, prompt count + test coverage#164

Merged
mrdailey99 merged 2 commits into
mainfrom
fix/PDX-476-main
May 12, 2026
Merged

PDX-476: fix(mcp): Copilot PR #161 follow-ups — AJV error mapping, catalog source shape, bin alias, prompt count + test coverage#164
mrdailey99 merged 2 commits into
mainfrom
fix/PDX-476-main

Conversation

@mrdailey99
Copy link
Copy Markdown
Collaborator

Summary

  • Fix ajvErrorToIssue to derive field/applies_to from err.params for additionalProperties and required AJV keywords (were silently using parent object path)
  • Normalize docs/NITROX_CATALOG_SOURCE.json to stable resource shape: remove exposed repo field, add schemasUpdated: null
  • Add provardx-cli bin alias in package.json so npx -y @provartesting/provardx-cli resolves unambiguously by package name
  • Update stale "7 MCP prompts" count to 11 in README.md and docs/mcp.md
  • Add regression test assertions for field and applies_to on all three AJV keyword cases (additionalProperties, required, type)

Jira

https://provartesting.atlassian.net/browse/PDX-476

Test plan

  • yarn compile passes
  • yarn test:only passes (955 passing)
  • yarn lint passes
  • Pre-push hook passes

Changes

  • src/mcp/tools/nitroXTools.ts: special-case additionalProperties/required in ajvErrorToIssue to pull property names from err.params
  • docs/NITROX_CATALOG_SOURCE.json: remove repo, add schemasUpdated: null
  • package.json: add provardx-cli bin alias
  • README.md, docs/mcp.md: update prompt count 7 → 11
  • test/unit/mcp/nitroXTools.test.ts: assert field/applies_to for all three AJV keyword cases; add required keyword test

mrdailey99 and others added 2 commits May 12, 2026 16:36
RCA: Four issues identified in post-merge Copilot review: AJV error
mapping for additionalProperties/required used instancePath (parent
object) instead of err.params, NITROX_CATALOG_SOURCE.json had an
exposed repo field and missing schemasUpdated key, the provardx-cli
bin alias was absent making npx resolution ambiguous, and prompt
counts in README/docs were stale at 7 (now 11).
Fix: ajvErrorToIssue now special-cases additionalProperties and
required keywords to pull field/applies_to from err.params; committed
JSON normalised to stable shape; package.json adds provardx-cli bin
alias; README.md and docs/mcp.md updated to 11 MCP prompts.
…ies and required errors

RCA: Copilot review noted that the new ajvErrorToIssue params-based mapping
for additionalProperties and required keywords had no test coverage for the
field and applies_to values, leaving the mapping free to silently regress.
Fix: Expanded NX_SCHEMA_ADDITIONAL_PROPERTIES test to assert field and
applies_to equal the extra property name; added NX_SCHEMA_REQUIRED case
asserting field and applies_to equal the missing property name; added
applies_to/field assertions to the NX_SCHEMA_TYPE test.
Copilot AI review requested due to automatic review settings May 12, 2026 21:37
@mrdailey99 mrdailey99 merged commit 0865983 into main May 12, 2026
2 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens NitroX AJV schema error reporting in the MCP validator by correctly identifying the offending field/path for additionalProperties and required errors, and adds regression tests to prevent future regressions. It also normalizes the published NitroX catalog-source metadata shape and makes npx -y @provartesting/provardx-cli ... resolve more predictably via an explicit bin alias, alongside doc count updates.

Changes:

  • Fix ajvErrorToIssue to derive field/applies_to from err.params for additionalProperties and required.
  • Normalize docs/NITROX_CATALOG_SOURCE.json shape (remove repo, add schemasUpdated: null) and document prompt count update (7 → 11).
  • Add provardx-cli bin alias and expand unit test coverage for AJV keyword mappings.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/mcp/tools/nitroXTools.ts Improves AJV error-to-issue mapping for additionalProperties/required so field/applies_to point to the correct leaf property.
test/unit/mcp/nitroXTools.test.ts Adds regression assertions for field/applies_to for additionalProperties, required, and type AJV errors.
docs/NITROX_CATALOG_SOURCE.json Aligns the shipped catalog-source JSON to a stable resource shape by removing repo and adding schemasUpdated.
package.json Adds provardx-cli as an additional npm bin alias to the same entrypoint.
README.md Updates MCP prompt count from 7 to 11.
docs/mcp.md Updates MCP prompt count from 7 to 11.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment on lines 42 to 45
"bin": {
"provardx": "./bin/mcp-start.js"
"provardx": "./bin/mcp-start.js",
"provardx-cli": "./bin/mcp-start.js"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants